<script type="text/html" template>
    <link rel="stylesheet" href="{{ layui.setter.base }}style/print.css?v={{ layui.setter.version }}" media="all">
</script>
<div class="child-box">
    <div class="layui-card layadmin-header mb20 print-hide">
        <div class="layui-breadcrumb" lay-filter="breadcrumb">
            <a href="javascript:" lay-href=""><i class="iconfont iconhome"></i>首页</a>
            <a href="javascript:" lay-href="/order/list">委托进口</a>
            <a href="javascript:" lay-href="/order/list">订单列表</a>
            <a><cite>查看费用</cite></a>

            <div class="layui-card-header-left" title="刷新" zmark-event="layui.manage.render">
                <i class="layui-icon layui-icon-refresh layui-anim" zmark-anim="layui-anim-rotate"></i>
            </div>
        </div>
    </div>
    <div class="layui-card">
        <form class="layui-form" method="post" lay-filter="form-order-base" id="orderMainForm">
            <div class="layui-card-header print-hide">
                <span class="def-fc">
                    <a href="javascript:" title="返回" class="head-go-back" onclick="history.back()"><i class="iconfont iconfanhui"></i></a>
                </span>
                <div class="fr">
                    <button type="button" class="layui-btn hollowing" onclick="javascript:window.print()"><i class="iconfont icondayin"></i>打印</button>
                    <button type="button" class="layui-btn hollowing" zmark-event="layui.printCost.export2Excel"><i class="iconfont iconexcel"></i>导出EXECL</button>
                    <button type="button" class="layui-btn hollowing" zmark-event="layui.printCost.export2Pdf"><i class="iconfont iconpdf"></i>导出PDF</button>
                </div>
            </div>
            <div class="layui-card-body">
                <div class="print-area" id="print-cost-view"></div>
            </div>
        </form>
    </div>
</div>
<script type="text/html" id="print-cost-temp">
    <div class="page-break">
        <div class="head">
            <div class="title18">{{d.subject.name}}</div>
            <div class="title12">{{layui.com.removeNull(d.subject.address)}}</div>
            <div class="title12">电话：<span style="min-width: 100px;display: inline-block">{{layui.com.removeNull(d.subject.tel)}}&nbsp;</span>  传真：<span style="min-width: 100px;display: inline-block">{{layui.com.removeNull(d.subject.fax)}}&nbsp;</span></div>
            <div class="title22">收款通知书</div>
        </div>
        <table width="100%" class="t-a-c" style="margin-top: 8px;margin-bottom: 8px;">
            <tbody>
            <td style="width: 8%">客户名称:</td><td style="border-bottom:solid #000 1px;width: 29%">{{d.order.customerName}}</td>
            <td style="width: 8%">订单号:</td><td style="border-bottom:solid #000 1px;width: 15%">{{d.order.docNo}}</td>
            <td style="width: 8%">订单日期:</td><td style="border-bottom:solid #000 1px;width: 12%">{{d.order.orderDate}}</td>
            <td style="width: 8%">结算汇率:</td><td style="border-bottom:solid #000 1px;width: 12%">{{layui.com.removeNull(d.order.impRate)}}</td>
            </tbody>
        </table>
        <div class="print-tab">
            <table>
                <thead>
                <tr>
                    <th>序号</th>
                    <th>物料</th>
                    <th>单价</th>
                    <th>数量</th>
                    <th>总价</th>
                    <th>币制</th>
                    <th>关税率</th>
                    <th>关税</th>
                    <th>增值税率</th>
                    <th>增值税</th>
                </tr>
                </thead>
                <tbody>
                {{# layui.each(d.members,function(i,o){}}
                <tr>
                    <td class="t-a-c">{{i+1}}</td>
                    <td>{{layui.com.removeNull(o.name)}};{{o.brand}};{{o.model}}</td>
                    <td class="t-a-r">{{o.unitPrice}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(o.quantity)}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(o.totalPrice)}}</td>
                    <td class="t-a-c">{{d.order.currencyName}}</td>
                    <td class="t-a-r">{{o.tariffRate}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(o.tariffRateVal)}}</td>
                    <td class="t-a-r">{{o.addedTaxTate}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(o.addedTaxTateVal)}}</td>
                </tr>
                {{#});}}
                <tr>
                    <td colspan="3"> 合计：</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(d.total.quantity)}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(d.total.totalPrice)}}</td>
                    <td></td>
                    <td></td>
                    <td class="t-a-r">{{layui.com.formatCurrency(d.total.tariffRateVal)}}</td>
                    <td></td>
                    <td class="t-a-r">{{layui.com.formatCurrency(d.total.addedTaxTateVal)}}</td>
                </tr>
                </tbody>
            </table>
            <table style="margin-top: 8px">
                <thead>
                <tr>
                    <th style="width: 130px;">费用科目</th>
                    <th style="width: 95px;">费用金额(元)</th>
                    <th style="width: 95px;">已付金额(元)</th>
                    <th style="width: 85px;">账期日</th>
                    <th style="width: 85px;">逾期利率%</th>
                    <th>费用说明</th>
                </tr>
                </thead>
                <tbody>
                {{# layui.each(d.costs,function(i,o){}}
                <tr>
                    <td>{{o.expenseSubjectName}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(o.receAmount)}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(o.acceAmount)}}</td>
                    <td class="t-a-c">{{o.periodDate}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(o.overdueRate)}}</td>
                    <td>{{layui.com.removeNull(o.memo)}}</td>
                </tr>
                {{#});}}
                </tbody>
            </table>
            {{#if(d.payments!=null && d.payments.length > 0){}}
            <table style="margin-top: 8px;">
                <thead>
                <tr>
                    <th>付款单号</th>
                    <th>申请日期</th>
                    <th>付汇汇率</th>
                    <th>付款金额</th>
                    <th>币制</th>
                    <th>人民币金额</th>
                </tr>
                </thead>
                <tbody>
                {{# layui.each(d.payments,function(i,o){}}
                <tr>
                    <td class="t-a-c">{{o.docNo}}</td>
                    <td class="t-a-c">{{o.accountDate}}</td>
                    <td class="t-a-r">{{o.exchangeRate}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(o.accountValue)}}</td>
                    <td class="t-a-c">{{o.currencyName}}</td>
                    <td class="t-a-r">{{layui.com.formatCurrency(o.accountValueCny)}}</td>
                </tr>
                {{#});}}
                </tbody>
            </table>
            {{#}}}
        </div>
<!--        <div style="text-align: left;font-size: 14px;margin-bottom: 8px;margin-top: 8px;">-->
<!--            <strong style="font-size: 12px;">毛重合计：</strong>-->
<!--            <div style="display: inline-block;width:250px;border-bottom: solid #000 1px; text-align: center;padding-bottom: 3px; ">-->
<!--                <strong>{{layui.com.formatCurrency(d.total.grossWeight)}}</strong>-->
<!--            </div>-->
<!--        </div>-->
        <div style="text-align: left;font-size: 14px;margin-bottom: 8px;margin-top: 8px;">
            <strong style="font-size: 12px;">费用合计：</strong>
            <div style="display: inline-block;width:250px;border-bottom: solid #000 1px; text-align: center;padding-bottom: 3px; ">
                <strong>{{layui.com.formatCurrency(d.total.receAmount)}}</strong>
            </div>元
        </div>
        <div style="margin-top: 8px;color: #ff0000">
            *注：费用信息以进口报关当日为准
        </div>
        <div style="margin-top: 8px">
            <p>请将以上应付款项按如下方式付至我司银行账户：</p>
            {{# layui.each(d.banks,function(i,o){}}
            <p>{{i+1}} 开户行：{{o.name}} 银行账号：{{o.account}} {{d.subject.name}}</p>
            {{#});}}
        </div>
    </div>
</script>
<script>
    layui.use('printCost', layui.factory('printCost'));
</script>